package com.clarence.dada.modular.system.dict.entity.req;

import com.clarence.dada.core.base.BaseReq;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 字典类型，请求参数封装
 *
 * @author GD
 * @since 2020/10/30 11:05
 */
@Data
@Schema(title = "系统字典类型请求实例")
@EqualsAndHashCode(callSuper = true)
public class DictTypeReq extends BaseReq {

    /**
     * 字典类型id
     */
    @NotNull(message = "id不能为空", groups = {edit.class, delete.class, detail.class, updateStatus.class})
    @Schema(title = "字典类型id", example = "admin")
    private Long dictTypeId;

    /**
     * 字典类型： 1-业务类型，2-系统类型，参考 DictTypeClassEnum
     */
    @NotNull(message = "字典类型不能为空", groups = {add.class, edit.class})
    @Schema(title = "字典类型", example = "admin")
    private Integer dictTypeClass;

    /**
     * 字典类型业务编码
     */
    @Schema(title = "字典类型业务编码", example = "admin")
    private String dictTypeBusCode;

    /**
     * 字典类型编码
     */
    @NotBlank(message = "字典类型编码不能为空", groups = {add.class, edit.class, validateCode.class})
    @Schema(title = "字典类型编码", example = "admin")
    private String dictTypeCode;

    /**
     * 字典类型名称
     */
    @NotBlank(message = "字典类型名称不能为空", groups = {add.class, edit.class})
    @Schema(title = "字典类型名称", example = "admin")
    private String dictTypeName;

    /**
     * 字典类型描述
     */
    @Schema(title = "字典类型描述", example = "admin")
    private String dictTypeDesc;

    /**
     * 排序，带小数
     */
    @NotNull(message = "排序不能为空", groups = {add.class, edit.class})
    @Schema(title = "排序", example = "admin")
    private BigDecimal dictTypeSort;

    /**
     * 参数校验分组：校验code是否可用
     */
    public @interface validateCode {

    }

}
